// Package name of the demo.
package com.example.demo.entity;

import com.example.demo.Service.myservice;
import org.apache.http.Consts;
import org.apache.http.HttpEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.mime.MultipartEntityBuilder;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
import org.springframework.stereotype.Service;

import java.io.File;

@Service
public class MyTokenFile implements myservice {

    public Result test(String a) {
        // Config url, token and filePath
        String url = "https://0b9efa1f9cdd47288c78599f891bb992.apig.cn-north-4.huaweicloudapis.com/v1/infers/5cac6c0e-5365-4292-bfe6-02cda335d252";
//        String token = "MIIOewYJKoZIhvcNAQcCoIIObDCCDmgCAQExDTALBglghkgBZQMEAgEwggyNBgkqhkiG9w0BBwGgggx+BIIMensidG9rZW4iOnsiZXhwaXJlc19hdCI6IjIwMjUtMDEtMDJUMTA6MTg6MjYuNjEyMDAwWiIsIm1ldGhvZHMiOlsicGFzc3dvcmQiXSwiY2F0YWxvZyI6W10sInJvbGVzIjpbeyJuYW1lIjoidGVfYWRtaW4iLCJpZCI6IjAifSx7Im5hbWUiOiJhcGlnX2FkbSIsImlkIjoiMCJ9LHsibmFtZSI6InRlX2FnZW5jeSIsImlkIjoiMCJ9LHsibmFtZSI6Im9wX2dhdGVkX2NzYnNfcmVwX2FjY2VsZXJhdGlvbiIsImlkIjoiMCJ9LHsibmFtZSI6Im9wX2dhdGVkX2Vjc19kaXNrQWNjIiwiaWQiOiIwIn0seyJuYW1lIjoib3BfZ2F0ZWRfZHNzX21vbnRoIiwiaWQiOiIwIn0seyJuYW1lIjoib3BfZ2F0ZWRfb2JzX2RlZXBfYXJjaGl2ZSIsImlkIjoiMCJ9LHsibmFtZSI6Im9wX2dhdGVkX2FfY24tc291dGgtNGMiLCJpZCI6IjAifSx7Im5hbWUiOiJvcF9nYXRlZF9kZWNfbW9udGhfdXNlciIsImlkIjoiMCJ9LHsibmFtZSI6Im9wX2d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RvbWFpbiI6eyJuYW1lIjoiaGlkX3o5MzF1ODFwcHlveXRmeSIsImlkIjoiOGI0NWFiYTJiYTZkNGZmM2JhNmJhNzdhNjk5OTViMzIifSwibmFtZSI6InRlc3QxIiwicGFzc3dvcmRfZXhwaXJlc19hdCI6IiIsImlkIjoiZjg2YmY1ZDk5N2VhNGNiODg1MmNkNjY4NjgwMDJjNTQifX19MYIBwTCCAb0CAQEwgZcwgYkxCzAJBgNVBAYTAkNOMRIwEAYDVQQIDAlHdWFuZ0RvbmcxETAPBgNVBAcMCFNoZW5aaGVuMS4wLAYDVQQKDCVIdWF3ZWkgU29mdHdhcmUgVGVjaG5vbG9naWVzIENvLiwgTHRkMQ4wDAYDVQQLDAVDbG91ZDETMBEGA1UEAwwKY2EuaWFtLnBraQIJANyzK10QYWoQMAsGCWCGSAFlAwQCATANBgkqhkiG9w0BAQEFAASCAQCbBWAlNh2vS18wxxP0nnU5lFaBCdK904v43LO-6LQ8c3tacarEC8XmBAV8RO+9+fAWcQRzVM+67jlEb+fcG5RYLRz9PSABznQ+aJ7hxnBWxNAPJ61SQn7WFolMtbBtFk6mAKIbiQYv9G060Q-OIbtcAg4NHUpSqKai67Ac4A3felJEY5cOsWCjvWdXUP41N9ViQlOtnHvkZ7mhyIostWOYJjSMDAQ+CCptIdq482t4H-JOOFW99CtdqbMnmeuVmDyi0ch8LabASRGkQ10Y86eCtvf5j4hTCWYx3JL4ZWwgrFjn6OknWMr4MBdpI4bvqFMPN8lHJxVl1uJ7yVau1WdW";
        String filePath = a;
        Result temp = new Result();
        try {
            // Create post
            HttpPost httpPost = new HttpPost(url);

            // Add header parameters
            httpPost.setHeader("X-Auth-Token", token);

            // Add a body if you have specified the PUT or POST method. Special characters, such as the double quotation mark ("), contained in the body must be escaped.
            File file = new File(filePath);
            HttpEntity entity = MultipartEntityBuilder.create().addBinaryBody("images", file).setContentType(ContentType.MULTIPART_FORM_DATA).setCharset(Consts.UTF_8).build();
            httpPost.setEntity(entity);

            // Send post
            CloseableHttpResponse response = HttpClients.createDefault().execute(httpPost);

            // Print result
            temp.code=response.getStatusLine().getStatusCode();

            temp.entity=EntityUtils.toString(response.getEntity());

            return temp;

        } catch (Exception e) {
            e.printStackTrace();
        }
        return temp;
    }
}
